using Senparc.Weixin.Exceptions;
using System;
using System.Collections.Generic;
namespace Senparc.Weixin.MP.TenPayLib
{
	public class TenPayInfoCollection : Dictionary<string, TenPayInfo>
	{
		public static TenPayInfoCollection Data = new TenPayInfoCollection();
		public new TenPayInfo this[string key]
		{
			get
			{
				if (!base.ContainsKey(key))
				{
					throw new WeixinException(string.Format("WeixinPayInfoCollection尚未注册Partner：{0}", key));
				}
				return base[key];
			}
			set
			{
				base[key] = value;
			}
		}
		public static void Register(TenPayInfo weixinPayInfo)
		{
			TenPayInfoCollection.Data[weixinPayInfo.PartnerId] = weixinPayInfo;
		}
		public TenPayInfoCollection() : base(StringComparer.OrdinalIgnoreCase)
		{
		}
	}
}
